﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TBlog.Web.Models.ModelMap
{
    public class CommentMap : BaseEntityTypeConfiguration<Comment>
    {
        public CommentMap()
        {
            HasKey(o => o.ID);
            ToTable("Comment");
            HasRequired(a => a.Article)
                .WithMany(a => a.Comments)
                .HasForeignKey(p => p.ArticleID)
                .WillCascadeOnDelete(true);

        }
    }
}